

#include "Test.h"

#if TEST_RTC
#include <string.h>
//#include "Led.h"
#include "RealTimeClock.h"
#include "Debug.h"

void TestRTC(void){
	TimeBCD  bcdTime = {
		.bcd_year = 0x22,
		.bcd_mon = 0x02,
		.bcd_mday = 0x27,
		.bcd_wday = 0x01,
		.bcd_hour = 0x23,
		.bcd_min = 0x24,
		.bcd_sec = 0x30,
	};
	RealTimeClock_SetBCD(&bcdTime);
	while(1){
		memset(&bcdTime, 0, sizeof(bcdTime));
		RealTimeClock_GetBCD(&bcdTime);
		DBG_WRITE("RTC:\r\n");
		DBG_PRINT("year:%X\r\n", bcdTime.bcd_year);
		DBG_PRINT("bcd_mon:%X\r\n", bcdTime.bcd_mon);
		DBG_PRINT("bcd_mday:%X\r\n", bcdTime.bcd_mday);
		DBG_PRINT("bcd_wday:%X\r\n", bcdTime.bcd_wday);
		DBG_PRINT("bcd_hour:%X\r\n", bcdTime.bcd_hour);
		DBG_PRINT("bcd_min:%X\r\n", bcdTime.bcd_min);
		DBG_PRINT("bcd_sec:%X\r\n", bcdTime.bcd_sec);
		DBG_WRITE("\r\n");
	}
}
#endif 


